package vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@NamedQueries({ 
	@NamedQuery(name = "Warn.findAll", query = "select e from Warn e"),
	@NamedQuery(name = "Warn.findByUserId", query = "select e from Warn e where e.user.id=?"),
	@NamedQuery(name = "Warn.findByTopicId", query = "select e from Warn e where e.topic.id=?"),
	@NamedQuery(name = "Warn.findTotalCount", query = "select count(*) from Warn t")
	})
@Table(name = "warn")
public class Warn extends BaseEntity {

	@Column(name="name")
	private String name;

	@JoinColumn(name = "user_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private User user;


	@JoinColumn(name = "topic_id")
	@ManyToOne(fetch = FetchType.LAZY)
	private Topic topic;

	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Topic getTopic() {
		return topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}
}
